<!DOCTYPE html>
<html>
<head>
<title>用户中心-地址管理</title>
<include file="Home@public/link" />
</head>
<body>
<!--顶部图层-->
<include file="Home@public/head1" />
<!--地址管理样式-->
<div class="user_style clearfix">
   <div class="user_center">
    <!--左侧菜单图层-->
    <include file="Home@public/user_center" />
    <!--右侧样式-->
        <div class="right_style">
            <div class="user_title_name"><span>地址管理</span></div>
            <div class="frame user_address clearfix">
              <!--地址列表-->
                <div class="Address_List clearfix"> 
                <!--地址类表-->
                    <foreach name='tist' item="vo">
                        <ul class="Address_info">
                            <div class="address_title">
                                <a href="#"></a>地址信息 
                                <a href="{$del}?id={$vo['id']}" class="delete"><i class="iconfont icon-close2"></i></a>
                            </div>
                            <li>{$vo['name']}</li>
                            <li>{$vo['address']}</li>
                            <li>{$vo['phone']}</li>
                            <li>{$vo['zip']}</li>
                        </ul> 
                    </foreach>         
                </div>
                <form action="{$address}" method="post">
                    <div class="Add_Addresss">
                        <div class="title_name"><i></i>添加地址</div>
                        <table>
                            <tr>
                                <td class="label_name">收货地址</td>
                                <td colspan="3" class="select"> 
                                    <span class="select_adderss"><label> 省份 </label>
                                        <select class="kitjs-form-suggestselect changeAct" id="level1" level="1" name="add1">
                                            <option value="0">请选择</option>
                                            <volist name="states" id="state">
                                                <option value="{$state.id}" >{$state.name}</option>
                                            </volist>
                                        </select>
                                    </span>
                                    <span class="select_adderss"><label> 市/县 </label>
                                        <select class="kitjs-form-suggestselect changeAct" id="level2" level="2" name="add2">
                                            <option value="0">请选择</option>
                                            <volist name="areas" id="area">
                                                <option value="{$area.id}">{$area.name}</option>
                                            </volist>
                                        </select>
                                    </span>
                                    <span class="select_adderss"><label> 区/县 </label>
                                        <select class="kitjs-form-suggestselect changeAct" id="level3" level="3" name="add3">
                                            <option value="0">请选择</option>
                                            <volist name="locals" id="local">
                                                <option value="{$local.id}">{$local.name}</option>
                                            </volist>
                                        </select></span>
                                    <span class="select_adderss"><label> 详细地址 </label><input name="add4" type="text" class="Add-text"/></span>
                                </td>
                            </tr>
                            <tr>
                                <td class="label_name">收件人姓名</td><td><input name="name" type="text"  class="Add-text"/><i>（必填）</i></td>
                                <td class="label_name">电子邮箱</td><td><input name="email" type="text"  class="Add-text"/><i>（必填）</i></td>
                            </tr>
                            <tr>
                                <td class="label_name">邮&nbsp;&nbsp;编</td><td><input name="zip" type="text"  class="Add-text"/><i>（必填）</i></td>
                                <td class="label_name">性&nbsp;&nbsp;别</td><td> 
                                <label class="sex"> <input type="radio" name="gerden" value="1" id="RadioGroup1_0"  class="select"/><span>男</span></label>
                                <label class="sex"><input type="radio" name="gerden" value="2" id="RadioGroup1_1" class="select"/><span>女</span></label><i>（选填）</i> </td>
                            </tr>
                            <tr>
                                <td class="label_name">手&nbsp;&nbsp;机</td><td><input name="phone" type="text"  class="Add-text"/><i>（必填）</i></td>
                                <td class="label_name">固定电话</td><td><input name="tel" type="text"  class="Add-text"/><i>（选填）</i></td>
                            </tr>
                            <tr>
                                <td class="label_name"></td><td></td><td class="label_name"></td><td></td>
                            </tr>             
                        </table>
                    <div class="address_Note"><span>注：</span>只能添加5个收货地址信息。请乎用假名填写地址，如造成损失由收货人自己承担。</div>
                        <div class="btn"><input name="1" type="submit" value="添加地址" class="Add_btn" /></div>       
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.changeAct').on('change',function(){
        $.ajax({
            type:'post',
            data:'pid='+$(this).val()+'&level='+$(this).attr('level'),
            url:'{$region}',
            dataType:'json',
            success:function(data){
                if (data.status=="ok") {
                    var html = '<option value="0">请选择</option>';
                        for (var i = 0; i < data.area.length; i++) {
                            html=html+'<option value="'+data.area[i].id+'">'+data.area[i].name+'</option>';
                        }
                        $level = parseInt(data.level)+1;
                        $('#level'+$level).html(html);
                }
            }
        });
    });
</script>
<include file="Home@public/right" />
</body>
</html>
